package com.yl.controller;


import com.yl.common.core.utils.poi.ExcelUtil;
import com.yl.common.core.web.controller.BaseController;
import com.yl.common.core.web.domain.AjaxResult;
import com.yl.common.core.web.page.TableDataInfo;
import com.yl.common.log.annotation.Log;
import com.yl.common.log.enums.BusinessType;
import com.yl.danmo.domain.DanmoInformationGuo;
import com.yl.service.IDanmoInformationGuoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 会员信息 国家级Controller
 * 
 * @author yangle
 * @date 2025-03-10
 */
@RestController
@RequestMapping("/danmoInformationGuo")
public class DanmoInformationGuoController extends BaseController
{
    @Autowired
    private IDanmoInformationGuoService danmoInformationGuoService;

    /**
     * 查询会员信息 国家级列表
     */
//    @RequiresPermissions("system:danmoInformationGuo:list")
    @GetMapping("/list")
    public TableDataInfo list(DanmoInformationGuo danmoInformationGuo)
    {
        startPage();
        List<DanmoInformationGuo> list = danmoInformationGuoService.selectDanmoInformationGuoList(danmoInformationGuo);
        return getDataTable(list);
    }

    /**
     * 导出会员信息 国家级列表
     */
//    @RequiresPermissions("system:danmoInformationGuo:export")
    @Log(title = "会员信息 国家级", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DanmoInformationGuo danmoInformationGuo)
    {
        List<DanmoInformationGuo> list = danmoInformationGuoService.selectDanmoInformationGuoList(danmoInformationGuo);
        ExcelUtil<DanmoInformationGuo> util = new ExcelUtil<DanmoInformationGuo>(DanmoInformationGuo.class);
        util.exportExcel(response, list, "会员信息 国家级数据");
    }

    /**
     * 获取会员信息 国家级详细信息
     */
//    @RequiresPermissions("system:danmoInformationGuo:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(danmoInformationGuoService.selectDanmoInformationGuoById(id));
    }

    /**
     * 新增会员信息 国家级
     */
//    @RequiresPermissions("system:danmoInformationGuo:add")
    @Log(title = "会员信息 国家级", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DanmoInformationGuo danmoInformationGuo)
    {
        return toAjax(danmoInformationGuoService.insertDanmoInformationGuo(danmoInformationGuo));
    }

    /**
     * 修改会员信息 国家级
     */
//    @RequiresPermissions("system:danmoInformationGuo:edit")
    @Log(title = "会员信息 国家级", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DanmoInformationGuo danmoInformationGuo)
    {
        return toAjax(danmoInformationGuoService.updateDanmoInformationGuo(danmoInformationGuo));
    }

    /**
     * 删除会员信息 国家级
     */
//    @RequiresPermissions("system:danmoInformationGuo:remove")
    @Log(title = "会员信息 国家级", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(danmoInformationGuoService.deleteDanmoInformationGuoByIds(ids));
    }

    @PostMapping("select")
    public void select(@RequestBody DanmoInformationGuo danmoInformationGuo)
    {
        //开始时间
        List<DanmoInformationGuo> list = danmoInformationGuoService.select(danmoInformationGuo);

    }
 @PostMapping("select1")
    public void select1(@RequestBody DanmoInformationGuo danmoInformationGuo)
    {

        List<DanmoInformationGuo> list = danmoInformationGuoService.select1(danmoInformationGuo);

    }
 @PostMapping("select2")
    public void select2(@RequestBody DanmoInformationGuo danmoInformationGuo)
    {

        List<DanmoInformationGuo> list = danmoInformationGuoService.select2(danmoInformationGuo);

    }
 @PostMapping("selectShi")
    public void selectShi(@RequestBody DanmoInformationGuo danmoInformationGuo)
    {

        List<DanmoInformationGuo> list = danmoInformationGuoService.selectShi(danmoInformationGuo);

    }


}
